#include "trap.h"
#include "include/logic_test.h"
   .set noat
   .globl main
   .set noreorder
   .text
main:
   TEST_AND(0x00000000, 0xFFFFFFFF, 0x00000000)
   TEST_AND(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF)
   TEST_AND(0xAAAAAAAA, 0x55555555, 0x00000000)
   TEST_AND(0xAAAAAAAA, 0x22222222, 0x22222222)

   TEST_ANDI(0x00000000, 0x0000FFFF, 0x00000000)
   TEST_ANDI(0xFFFF0000, 0x0000FFFF, 0x00000000)
   TEST_ANDI(0xAAAAAAAA, 0x00008000, 0x00008000)
   TEST_ANDI(0xAAAAAAAA, 0x00005555, 0x00000000)

   TEST_LUI(0x0000FFFF, 0xFFFF0000)
   TEST_LUI(0x00001234, 0x12340000)
   TEST_LUI(0x0000FFF4, 0xFFF40000)
   TEST_LUI(0x00000000, 0x00000000)

   TEST_NOR(0x00000000, 0xFFFFFFFF, 0x00000000)
   TEST_NOR(0xAAAAAAAA, 0x55555555, 0x00000000)
   TEST_NOR(0xAAAAAAAA, 0x00000000, 0x55555555)
   TEST_NOR(0x55555555, 0x00000000, 0xAAAAAAAA)

   TEST_OR(0x00000000, 0xFFFFFFFF, 0xFFFFFFFF)
   TEST_OR(0xAAAAAAAA, 0x55555555, 0xFFFFFFFF)
   TEST_OR(0xAAAAAAAA, 0x00000000, 0xAAAAAAAA)
   TEST_OR(0x55555555, 0x00000000, 0x55555555)

   TEST_ORI(0x00000000, 0x0000FFFF, 0x0000FFFF)
   TEST_ORI(0x0000AAAA, 0x00005555, 0x0000FFFF)
   TEST_ORI(0xFFFF0000, 0x00001234, 0xFFFF1234)
   TEST_ORI(0xFFFF5555, 0x0000AAAA, 0xFFFFFFFF)

   TEST_XOR(0x00000000, 0xFFFFFFFF, 0xFFFFFFFF)
   TEST_XOR(0xAAAAAAAA, 0x55555555, 0xFFFFFFFF)
   TEST_XOR(0xAAAAAAAA, 0xAAAAAAAA, 0x00000000)
   TEST_XOR(0x55555555, 0x00000000, 0x55555555)

   TEST_XORI(0x00000000, 0x0000FFFF, 0x0000FFFF)
   TEST_XORI(0x0000AAAA, 0x00005555, 0x0000FFFF)
   TEST_XORI(0xFFFF0000, 0x00001234, 0xFFFF1234)
   TEST_XORI(0xFFFF5555, 0x0000AAAA, 0xFFFFFFFF)
   TEST_XORI(0xFFFF5555, 0x00005555, 0xFFFF0000)
   
   
   HIT_GOOD_TRAP		#stop temu

inst_error:
   HIT_BAD_TRAP #report wrong
